Upgrade to spring-boot 4#922
Merged
Merged
Conversation
and replace spring-boot-starter-test by spring-boot-starter-webmvc-test (which brings in spring-boot-starter-test as transitive dependency) https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide#deprecated-starters https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide#test-code
as it does not appear to do anything
b5d290c to
fdf8340
Compare
this is already pulled in by spring-boot-starter-data-mongodb (via spring-boot-starter-mongodb) https://central.sonatype.com/artifact/org.springframework.boot/spring-boot-starter-data-mongodb/4.0.6 https://central.sonatype.com/artifact/org.springframework.boot/spring-boot-data-mongodb/4.0.6
cannot find this in spring-data-commons release notes, but see e.g. spring-projects/spring-data-neo4j@1c11be9
and fix corresponding RestTemplateBuilder import and replace deprecated setConnectionTimeout and setReadTimeout calls https://docs.spring.io/spring-boot/3.4/api/java/org/springframework/boot/web/client/RestTemplateBuilder.html
bringing in the metrics and sparql proxy
pulling in fixes to metrics config and default profile
pulling in the updated cors config and the fix for removed .apply() method in SecurityConfig
…Server these have been moved from org.springframework.boot.test.autoconfigure.web to two different packages
…onding metrics imports see spring-projects/spring-boot#50788
because spring-boot-starter-actuator already pulls that in https://github.com/spring-projects/spring-boot/blob/2edca39504f8e9c2943262d3e60ba34b0e7751ac/starter/spring-boot-starter-actuator/build.gradle#L25
it is not used, and also gives rise to the following error in spring-boot 4: incompatible types: org.springframework.http.HttpHeaders cannot be converted to java.util.Map<java.lang.String,java.util.List<java.lang.String>>
class has been moved to org.springframework.boot.resttestclient package in spring-boot 4
because org.springframework.boot.http.client.ClientHttpRequestFactorySettings has been removed, apparently
pulling in the checkstyle rule to allow long URls in inline comments
was listed under 'Test' dependencies, but does not specify the test scope
This is available via spring-boot starters (jetty?), but we depend heavily on this package and import explicitly from it, so better make the dependency explicit. The package version is managed by spring boot. https://docs.spring.io/spring-boot/appendix/dependency-versions/coordinates.html
for compatibility with spring-boot 4 (spring 7)
because @SpringBootTest no longer provides the TestRestTemplate bean, as mentioned in the migration guide: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide#using-webclient-or-testresttemplate-and-springboottest
this was done following the spring-boot-starter-classic workflow described in the spring boot 4 migration guide
we import directly from the jackson packages in many places, so the dependency should be explicit instead of only transitive
this is the only use of @nullable in the fdp
to get rid of the nullpointerexceptions in tests, like:
Cannot invoke "org.fairdatateam.fairdatapoint.entity.schema.MetadataSchema.getTargetClasses()"
because the return value of "java.util.Map.get(Object)" is null at
org.fairdatateam.fairdatapoint.service.resource.ResourceDefinitionTargetClassesCache.lambda$computeCache$2(ResourceDefinitionTargetClassesCache.java:84)
pulling in DRY project versioning and some dependency updates
alternative would be something like: ```java @configuration public class MongoClientConfig extends AbstractMongoClientConfiguration { @value("${spring.mongodb.database}") private String databaseName; @OverRide protected void configureClientSettings(MongoClientSettings.Builder builder) { builder.uuidRepresentation(UuidRepresentation.STANDARD); } @OverRide protected @nonnull String getDatabaseName() { return databaseName; } } ``` https://docs.spring.io/spring-data/mongodb/reference/migration-guide/migration-guide-4.x-to-5.x.html
…onCreator fixes the "Cannot map `null` into type `boolean`" error also see FasterXML/jackson-databind#5318 and https://github.com/FasterXML/jackson/wiki/Jackson-Release-3.0#jackson-databind
* change MetadataSchemaDraftDTO.abstractSchema boolean to Boolean this fixes the following error: "Cannot map null into type boolean (set DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES to 'false' to allow)" * replace ObjectMapper by JsonMapper with new builder api - fix corresponding imports: com.fasterxml.jackson moved to tools.jackson except for com.fasterxml.jackson.annotation - replace JsonProcessingException by JacksonException - replace MappingJackson2HttpMessageConverter by JacksonJsonHttpMessageConverter
while we're at it
because the original method is deprecated for removal
Contributor
Author
|
All tests are passing and application starts without errors or warnings. First quick manual interactions via client are looking good. |
because it is imported everywhere in the code, but was only included transitively (implicitly)
Contributor
Author
|
End-to-end tests from the E2E repo also pass (running locally). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #920 (see issue for detailed notes)
fixes #933 (via #934)
Note
If you're seeing mongodb connection issues, make sure your run configuration is updated to use
spring.mongodb.uriinstead of the oldspring.data.mongodb.uri.